package study.rocketmq.consumer;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import study.rocketmq.vo.Order;

/**
 * 普通消息
 */
@Component
@RocketMQMessageListener(topic = "TopicOrder", consumerGroup = "CONSUMER_GROUP_ORDER")
public class OrderObjectListener implements RocketMQListener<Order> {

    @Override
    public void onMessage(Order order) {
        // 调用数据库 update 库存表
        System.out.println("监听到Order:"+order);
    }
}
